#python 3.5.3  蔡军⽣
#http://edu.csdn.net/course/detail/2592    
#  
from scipy.stats import binom
import matplotlib.pyplot as plt
import numpy as np
n = 10
p = 0.3
k = np.arange(0, 21)
binomial = binom.pmf(k, n, p)
print(binomial)
plt.plot(k, binomial, 'o-')
plt.title('Binomial: n = %i, p=%0.2f' % (n, p),fontsize = 15)
plt.xlabel('Number of successes')
plt.ylabel('Pr')